package com.prs.crm.dao.approval.impl;

import java.util.Collection;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.approval.JobTypeDao;
import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.domain.approval.JobType;

public class JobTypeDaoImpl extends BaseDaoImpl<JobType> implements JobTypeDao{

	@Override
	public Collection<JobType> getRootJobTypes() {
		Criteria cri = this.getSession().createCriteria(JobType.class)
						.add(Restrictions.isNull("parent"));
		return cri.list();
	}

	@Override
	public List<JobType> getAllJobTypes() {
		Criteria cri = this.getSession().createCriteria(JobType.class);
		return cri.list();
	}

}
